extern int sse_ctrl();

int check_fpu() {
	int result;
	__asm__ __volatile__("movl %cr0,%eax");
	__asm__ __volatile__("movl %eax,%edi");
	__asm__ __volatile__("andl $0x0FFFFFFEF,%eax");
	__asm__ __volatile__("movl %eax,%cr0");
	__asm__ __volatile__("movl %cr0,%eax");
	__asm__ __volatile__("xchgl %edi,%eax");
	__asm__ __volatile__("movl %eax,%cr0");
	__asm__ __volatile__("movl %edi,%eax");
	__asm__ __volatile__("andl $0x10,%eax");
	__asm__ __volatile__("shrb $4,%al");
	__asm__ __volatile__("movl %%eax,%0":"=r"(result) : :"eax");
	return result;
}

int check_sse() {
	//int result;
	//__asm__ __volatile__("movl $1,%eax");
	//__asm__ __volatile__("cpuid");
	//__asm__ __volatile__("movl %%eax,%0":"=r"(result) : :"edx"); //<-- da errori
	//return result;
}

/*asm { .text
.globl sse_ctrl
sse_ctrl:
	pushl %ebp
	movl $1,%eax
	cpuid
	movw 8(%ebp),%ax
	popl %ebp
	ret
};*/
